package com.example.mybatisdemo.demos.web.controller;

import com.example.mybatisdemo.demos.web.model.UserInfo;
import com.example.mybatisdemo.demos.web.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("user")
@RestController
public class UserInfoController {

    @Autowired
    private UserInfoService service;

    @RequestMapping("/getAllUser")
    public List<UserInfo> getAllUser(){
        return service.getAllUser();
    }

    @RequestMapping("/getUser")
public UserInfo getUser(Integer id){
        return service.getUser(id);
    }
}
